1. Field of the Invention
The invention relates in general to color image processing, and in particular to a system for correcting artifacts in a color image, such as the red eye created by camera flashes.
2. Related Art
Red-eye artifacts are a well-known problem in photography. Red-eye artifacts are caused by light entering a subject""s eye through the pupil, reflecting off the retina at the back of the eye, and traveling back through the pupil toward the camera lens. The light typically comes from a flash attached to the camera taking the photograph. The reflection is red because the retina absorbs non-reddish components of the light entering the eye.
Several systems or methods have been proposed or attempted to reduce the problem of red-eye artifacts at the time the photograph is taken. One commonly known technique is to increase the distance between the flash and the lens. Although a substantially equal amount of light is reflected, less of the light is reflected toward the lens. Another common technique is to take several pre-flashes to reduce the size of the subject""s pupils. These solutions, however, are not satisfactory because red-eye artifacts, although usually less pronounced, typically remain. Also, increasing the distance between the flash and the lens generally requires a less compact and less user-friendly camera. Furthermore, pictures taken with multiple pre-flashes consume more power than those taken with a single flash and require more time to take a picture. Therefore, red-eye artifacts continue to be a significant problem in amateur photography.
Various digital processing techniques have been created in an effort to remove red-eye artifacts from photographs in post-image capture processing. Such packages include Microfrontier""s (trademark) Digital Dark Room(trademark), Photodex""s (trademark) CompPic(trademark), Microsoft""s (trademark) PhotoDraw(trademark), Adobe""(trademark) PhotoDeluxe(trademark), and Corel""s(trademark) CorelScan(trademark), which use techniques for removing red eye with varying, but often less than satisfactory, success.
A need exists to remove the red-eye without removing the specular reflection of the flash, because the specular reflection is often a desirable feature of the image. A need also exists to make red-eye removal appear more natural. Some prior art techniques fail to eliminate all of the red eye, make the pupil look unnaturally large, leave unnatural-looking red-fringes around the pupil, or make the transition between the pupil and the surrounding iris look too abrupt.
A system of correcting artifacts of a color image is provided where image capture circuitry captures the color image and image processing circuitry identifies and corrects artifacts in the color image. To identify the artifact, the image processing circuitry compares all or a part of the color image to at least one reference color characteristic. To correct the artifact, which has a plurality of color characteristics, the image processing circuitry modifies at least one of the color characteristics of the artifact. This modification process reduces the color saturation of red-eye artifacts to at or near zero, obtaining an achromatic appearance of the pupil.
The invention also provides a system for identifying artifacts by computing a color difference mask of at least a portion of the image containing the artifact. The color difference mask is computed by calculating, for each pixel of the portion of the image being analyzed, the colorimetric distances between the color of the pixel and a predefined typical artifact color. Additional systems provide enhancement of the red-eye artifact identification process by reducing each pixel of the mask to one of two values based on a comparison with a threshold value, and by filtering and adjusting the mask.
Another system provides converting the identified red-eye portions of an image to a substantially monochrome color that accommodates the fact that the pupil of the eye is substantially black. The bright, substantially white, specular reflection of the eye is preserved by keeping the luminance of the corrected pixels substantially unchanged.
The invention also improves the artifact-detecting and correcting functionality of the color difference mask by applying morphological filtering and blob analysis operations on the mask. Image appearance is further improved by tapering the color correction process near the perimeter of the red-eye artifact.